<style>
	.text-upload{display: inline-block;position: absolute;left: 49%;cursor: pointer;z-index: 0;font-weight: bold;margin-top:8px;}
</style>
<div class="hidden OptionTitle">添加</div>
<div class="hidden OptionBtn">保存</div>
<form class="checkoutform" action="{:U('insert')}" method="post">
  <div class="form-group"  data-position="top" data-intro="此处填写公告标题">
    <label class="control-label">标题</label>
    <input class="form-control" datatype="*"  nullmsg="标题不能为空" errormsg="输入限制为文本" name="title" type="text" placeholder="请输入标题！" id="title">
  </div>
  <div class="form-group"  data-position="top" data-intro="此处填写公告内容">
    <label class="control-label">内容</label>
    <textarea class="form-control" datatype="*"  nullmsg="内容不能为空" errormsg="输入限制为文本" name="content" placeholder="请输入内容！" cols="50" rows="6" id="content"></textarea>
  </div>
  <div class="text-upload">点击上传附件</div> 
  <iframe id="uploadiframe" src="{:U('upload')}" style="height:40px; width:60%;" appendto="#filebox" class="uploadiframe pull-right" filename="img_url[]"  data-position="bottom" data-intro="此处可以上传附件"></iframe>
  <div class="clearfix"></div>
<div id="filebox" class="dropzone form-group"></div>
  <div class="form-group"   data-position="bottom" data-intro="设置公告发布的范围" >
  	<label class="control-label">可观看用户</label>
    <div class="icheck clearfix">
      <div style="display:inline-block;">
        <div class="radio square-red single-row">
          <input type="radio" value="1" name="pid">
          <label>全公司</label>
        </div>
      </div>
      <div style="display:inline-block;">
        <div class="radio square-red single-row">
          <input type="radio" value="0" name="pid">
          <label>私人</label>
        </div>
      </div>
    </div>
  </div>
</form>
<script>
	$("#filebox").bind("DOMNodeInserted",function(e){
		$.ThinkBox.success('上传成功',{'delayClose':1000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
	});
	$(".text-upload").click(function(e) {
        document.getElementById('uploadiframe').contentWindow.$(".dropzone").click();
    });
	
</script>